package GUILayer;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class StatisticUI extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public StatisticUI() {
		initialize();
	}

	public void initialize() {

		String loggedInPosition = LoginUI.getLoggedInPosition();

		this.setLayout(new BorderLayout(0, 0));

		JTabbedPane subMenu = new SubMenuTabbedPane();
		this.add(subMenu, BorderLayout.CENTER);

		JPanel customersStatistic = new CustomerStatisticUI();
		subMenu.add(customersStatistic, "Customers");

		if (loggedInPosition.equals("admin")
				|| loggedInPosition.equals("manager")) {
			JPanel employeesStatistic = new EmployeeStatisticUI();
			subMenu.add(employeesStatistic, "Employees");
		}
	}

}
